<template>
  <div>
    
            <div class="activitys">
              
            <div class="activityList" @click="btnClick(item)" v-for="(item,index) in activityList" :key="index">
             <div> 
           <!-- <img style="width: 100%;text-align: center;" :src="item.url"></div> -->
            <div class="title" >{{ item.activityTitle}}</div>
            <div class="time" >{{ item.createTime}}</div>
            <van-divider />
            </div>

  </div>
  </div>
  </div>
</template>
<script>
import {listActivity, listActivityClick, updateActivityClick} from "@/api/activity";

  export default {
    data(){
          return {
            // 总条数
      total: 0,
      // 活动表格数据
      activityList: [],
      activityListClick: [],
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        activityTitle: undefined,
        createBy: undefined,
        status: '0'

          }
          }
    },
  computed: {
    key() {
      return this.$route.path
    }
  },
 mounted() {
    this.getActivityList();
  },
      created() {},
  methods: {
    /** 查询活动列表 */
    getActivityList() {
      listActivity(this.queryParams).then(response => {
        this.activityList = response.rows;
        this.total = response.total;
      });
      listActivityClick(this.queryParams).then(res=>{
        this.activityListClick=res.rows
      })
    },

    //点击选中
    btnClick(data) {
      updateActivityClick(data)
      console.log(data)
      this.$router.push({
        path: './activitydetail/main',
        query: {
          id: data.activityId
        }
      })
    },
  }

}

</script>
<style scoped>
.activitys{
  background-color: rgb(255, 255, 255);
  width: 95%;
  margin: 20rpx 20rpx 15rpx;
  -moz-box-shadow:2rpx 2rpx 5rpx #969696;
  -webkit-box-shadow:2rpx 2rpx 5rpx #838080;
  box-shadow:2rpx 2rpx 5rpx #969696;
  display:flex;
	padding:0 0px;
	flex-wrap:wrap;
  border-radius: 5px;
}
.activityList{
  width: 95%;
   font-size: 12pt;
    padding: 20rpx;
}
.title{
  color: #070707;
}
.time{
   text-align: right;
   color: #35353598;
   font-size: 10pt;
}
</style>